<?php
class Server {
  public static function login() {
    $fail_url = Utils::get_param('fail_url', '');
    $succ_url = Utils::get_param('succ_url', '');
    $user = Utils::get_param('user', '');
    $pass = Utils::get_param('pass', '');
    if ($user == INSTALL_USER && $pass == INSTALL_PASS) {
      unset($_SESSION[LOGIN_ERROR]);
      $_SESSION[IS_AUTHENTICATED] = true;
      header('location: ' . $succ_url);
    } else {
      $_SESSION[LOGIN_ERROR] = 'Incorrect Login/Password';
      header('location: ' . $fail_url);
    }
  }
}
?>